<?php

	header("Content-Type: text/html;charset=utf-8"); 

	include("../function/_nosql.php");

	include("../function/function.php");
	
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
    <title>登陆_<?php echo $web_titles; ?></title>
    <link rel="stylesheet" href="css/bootstrap.min.css"/>
    <link rel="stylesheet" href="css/style.css"/>
    <script type="text/javascript" src="../js/baidutongji.js"></script>
</head>
<body class="login">
    <div class="loginbg">
        <div class="login_logo">
        	<div class="text-center"><a href="index.php"><img src="image/logo1.png" alt="中国徒步网首页" title="中国徒步网首页"/></a></div>
        </div>
        <div class="login_form">
        	<div class="title">欢迎登录中国徒步网</div> 
        	<div class="f-login-hd"><a href="zhuce.php">没有账号？注册</a></div>
        	<form id="loginform" action="../chklogin.php?action=chklogin" method="post">
        		<div class="logininput">
	        	<i class="iconfont">&#xe620;</i><input id="user_email"  type="text" name="user_email" class="form-control" placeholder="请输入账号"/>
		        </div>
		        <div class="logininput">
		            <i class="iconfont">&#xe61f;</i><input type="password" id="user_password" name="user_password" class="form-control" placeholder="请输入密码"/>
		        </div>
		        <div class="f-login">
                        <input name="user_passcode" id="user_passcode" value="" type="text" placeholder="验证码" class="login-input login_chest">

                        <span class="yzm"><img src="../function/code.php" width="103" height="35" class="imgCode reshCode"></span>

                        <span><a href="javascript:void(0);" class="reshCode">看不清？？</a></span>
                    </div>
		        <div class="text-center lab-password">
		        	<span class="auto-login"><label><input type="checkbox" name="zidong" value="1">自动登录</label></span>
		            <span class="find-password"><a href="#">忘记密码</a></span>
		        </div>
		        <div class="logininput">
		           <input type="submit" class="form-control denglu" value="登 陆"/>
		        </div>
        	</form>
        </div>
    </div>
</body>
<script type="text/javascript" src="../js/jquery-1.10.2.min.js"></script>
<script type="text/javascript">
		// 刷新验证码

		$(".reshCode").click(function(){

			$(".imgCode").attr("src","../function/code.php?nums=" + Math.random());   

		});
		// 表单提交

		$("#loginform").submit(function(){

			var user_email = $("#user_email").val();

			var user_password = $("#user_password").val();

			var user_passcode = $("#user_passcode").val();

			

			// 用户名验证

			if(user_email.replace(/\ /g,"").length<1){

				alert("Email或手机号不能为空！");

				$("#user_email").focus();

				return false;

			}
			
			// 密码验证

			if(user_password.replace(/\ /g,"").length<1){

				alert("密码不能为空！");

				$("#user_password").focus();

				return false;

			}

			// 验证码验证

			if (user_passcode.replace(/\ /g,"").length<1){

				alert("请正确输入验证码！");

				$("#user_passcode").focus();

				return false;

			}

			if (isNaN(user_passcode.replace(/\ /g,""))){

				alert("请正确输入验证码！");

				$("#user_passcode").focus();

				return false;

			}

		});

</script>

</html>